package gang.org.springframework.framework.util;

import java.io.Serializable;
import java.util.*;

/**
 * @Author：gang.chen
 * @Date：2023/10/12 14:40
 */
public class GangMultiValueMapAdapter<K, V> implements GangMultiValueMap<K, V>, Serializable {

    private final Map<K, List<V>> targetMap;

    public GangMultiValueMapAdapter(Map<K, List<V>> targetMap) {
        this.targetMap = targetMap;
    }

    @Override
    public void add(K key, V value) {
        List<V> values = this.targetMap.computeIfAbsent(key, k -> new ArrayList<>(1));
        values.add(value);
    }

    @Override
    public int size() {
        return this.targetMap.size();
    }

    @Override
    public boolean isEmpty() {
        //TODO
        return false;
    }

    @Override
    public boolean containsKey(Object key) {
        //TODO
        return false;
    }

    @Override
    public boolean containsValue(Object value) {
        //TODO
        return false;
    }

    @Override
    public List<V> get(Object key) {
        //TODO
        return null;
    }

    @Override
    public List<V> put(K key, List<V> value) {
        //TODO
        return null;
    }

    @Override
    public List<V> remove(Object key) {
        //TODO
        return null;
    }

    @Override
    public void putAll(Map<? extends K, ? extends List<V>> m) {
        //TODO
    }

    @Override
    public void clear() {
        //TODO
    }

    @Override
    public Set<K> keySet() {
        //TODO
        return null;
    }

    @Override
    public Collection<List<V>> values() {
        return this.targetMap.values();
    }

    @Override
    public Set<Entry<K, List<V>>> entrySet() {
        //TODO
        return null;
    }
}
